package com.jwsoft.manager.core.task.sjgx;

import com.jwsoft.manager.common.enums.IrsSyncTypeEnum;
import com.jwsoft.manager.common.vo.common.AreaControlVO;
import com.jwsoft.manager.core.integration.individuation.DyIrsSyncIntegration;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

/**
 * irs本地程序发送省irs接口定时任务--户籍
 * */
@Configuration
@EnableScheduling
@ConditionalOnProperty(name = "system.config.irs.send.flag")
@Slf4j
public class DyHjIrsSendJob {
    @Autowired
    private DyIrsSyncIntegration dyIrsSyncIntegration;
    //每1分钟执行一次 户籍接口发送错误数据重新发送
    @Scheduled(fixedDelay = 60000)
    private void IRSGX0003Tasks() {
        AreaControlVO vo= new AreaControlVO();
        vo.setSyncType(IrsSyncTypeEnum.hj.getType());
        log.info("irs大数据户籍获取开始");
        dyIrsSyncIntegration.sendIrsTaskData(vo);
        log.info("irs大数据户籍获取结束");
    }

}
